package com.base.common.model.po;

import com.base.common.model.dto.BaseDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * C端用户Dto
 *
 * @author admin
 * @date 2020/9/9 上午10:59
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@ApiModel(value = "UserInfoDto", description = "C端用户Dto")
public class UserInfoPo extends BaseDto implements Serializable {
    private static final long serialVersionUID = -1L;

    @ApiModelProperty(value = "主键id")
    protected Long id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "性别：1男 2女")
    private String sex;

    @ApiModelProperty(value = "生日")
    private String birthday;

    @ApiModelProperty(value = "会员头像")
    private String headImg;

    @ApiModelProperty(value = "会员来源：1后台 2小程序 3H5营销拉新")
    private String source;

    @ApiModelProperty(value = "会员属性：1已注册 2已消费")
    private String attribute;

    @ApiModelProperty(value = "会员等级")
    private String grade;

    @ApiModelProperty(value = "状态-0无效1有效2未激活")
    private String status;

    @ApiModelProperty(value = "会员二维码")
    private String qrCode;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建用户id")
    private String createEmp;

    @ApiModelProperty(value = "创建用户name")
    private String createEmpName;

    @ApiModelProperty(value = "更新用户id")
    private String modifyEmp;

    @ApiModelProperty(value = "更新用户name")
    private String modifyEmpName;

    @ApiModelProperty(value = "会员所属公司名称")
    private String companyName;

    @ApiModelProperty(value = "最后登录时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastLoginTime;

    @ApiModelProperty(value = "token失效时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime tokenExpireTime;
}